<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <base href="http://localhost:8080/"/>
    <script src="js/axios.min.js"></script>
    <script src="js/vue.js"></script>
</head>
<body>
<div id="app">
    <ul>
        <li v-for="book in bookInfo" :key="book.bookId"><a href="#">{{book.bookName}}</a></li>
    </ul>
</div>

<script>
    new Vue({
        el: '#app',
        data() {
            return {
                bookInfo: []
            }
        },
        methods: {
            getBookInfos() {
                axios.get('http://localhost:8080/book/showbook.do').then(res => {
                    // 数据模型的确定
                    this.bookInfo = res.data
                    console.log(res.data)
                })
            }
        },
        mounted() {
            console.log(this.bookInfo)
            this.getBookInfos()
        }
    })
</script>

</body>
</html>